package demo2;

import java.util.LinkedList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.Node root = binaryTree.createTree();
        System.out.print("树的节点个数 : ");
        System.out.println(binaryTree.size(root));
        System.out.print("树的叶子节点个数 : ");
        System.out.println(binaryTree.getLeafNodeCount(root));
        System.out.print("第3层的节点个数 : ");
        System.out.println(binaryTree.getKLevelNodeCount(root,3));
        System.out.print("树的高度 : ");
        System.out.println(binaryTree.getHeight(root));
        System.out.print("找到21这个节点 : ");
        BinaryTree.Node node = binaryTree.find(root,21);
        System.out.println(node.val);
        System.out.println(binaryTree.isCompleteTree(root));
    }
}
